package system.company.webservice.servlets;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import system.company.actor.Manager.Manager_Staff;
import system.company.actor.Ordinary_Staff.Ordinary_Staff;
import system.company.bountry.display_Forms.Web_Company_Notices_Form;
import system.company.control.Centers.Operation_Center;

public class Quit extends HttpServlet {

	/**
	 * Constructor of the object.
	 */
	public Quit() {
		super();
	}

	/**
	 * Destruction of the servlet. <br>
	 */
	public void destroy() {
		super.destroy(); // Just puts "destroy" string in log
		// Put your code here
	}

	/**
	 * The doGet method of the servlet. <br>
	 *
	 * This method is called when a form has its tag value method equals to get.
	 * 
	 * @param request the request send by the client to the server
	 * @param response the response send by the server to the client
	 * @throws ServletException if an error occurred
	 * @throws IOException if an error occurred
	 */
	private void processRequest(HttpServletRequest request,
			HttpServletResponse response) throws IOException {

		response.setContentType("text/html;charset=gb2312");
		PrintWriter out = response.getWriter();
		response.setStatus(HttpServletResponse.SC_OK);
		// response.setContentType("text/html");
		
		
		HttpSession hsession=request.getSession();
		hsession.invalidate();
		response.sendRedirect("/J2EE_CompanyManagement_Project/Common_Page/Entrance_face.jsp");
		// first get the dynamic response
		// generate the HTTP Output document
	
		
		// out.println("<H1> "+Card_ID+"</H1>");
		
	}
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		processRequest(request,response);
	}

	/**
	 * The doPost method of the servlet. <br>
	 *
	 * This method is called when a form has its tag value method equals to post.
	 * 
	 * @param request the request send by the client to the server
	 * @param response the response send by the server to the client
	 * @throws ServletException if an error occurred
	 * @throws IOException if an error occurred
	 */
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {


		processRequest(request,response);
	}
	/**
	 * Initialization of the servlet. <br>
	 *
	 * @throws ServletException if an error occurs
	 */
	public void init() throws ServletException {
		// Put your code here
	}

}
